<?php


namespace app\admin\model;


use think\Model;
use think\model\concern\SoftDelete;

class Item extends Model
{
    use SoftDelete;
    protected $name = 'projects';

    const PROGRESS_ONE = 1;
    const PROGRESS_TWO = 2;
    const PROGRESS_THREE = 3;
    const PROGRESS_FOUR = 4;
    const PROGRESS_FIVE = 5;
    const PROGRESS_SIX = 6;

    public static $progress = array(
        self::PROGRESS_ONE => '部门审核中',
        self::PROGRESS_TWO => '部门不通过',
        self::PROGRESS_THREE => '部门预算中',
        self::PROGRESS_FOUR => 'BOSS审批中',
        self::PROGRESS_FIVE => 'BOSS不通过',
        self::PROGRESS_SIX => '通过'

    );


    public function admin()
    {
        return $this->belongsTo(Admin::class, 'admin_id');
    }

    public function ExamineAdmin()
    {
        return $this->belongsTo(Admin::class, 'examine_admin_id');
    }

    public function FinalAdmin()
    {
        return $this->belongsTo(Admin::class, 'final_admin_id');
    }


    public function AuthGroup()
    {
        return $this->belongsTo(AuthGroup::class, 'group_id');
    }

    public function ProjectBudget()
    {
        return $this->hasOne(ProjectBudget::class, 'project_id');
    }

    public function dept(){
        return $this->belongsTo(Department::class,'group_id');
    }
}